import Vue from 'vue'
import Vuex from 'vuex'
import index from './modules/index'
import login from './modules/login'
import account from './modules/account'
import VuexPersistence from 'vuex-persist'
Vue.use(Vuex)
// 创建一个vuex持久化对象
const vuexLocal = new VuexPersistence({
    storage: window.localStorage,
    // 对那些模块进行持久化,若不设置,则对所有模块进行持久化
    modules: ['index']
})


const store = new Vuex.Store({
    modules: {
        login,
        index
    },
    // 添加持久化对象
    plugins: [vuexLocal.plugin]
})

export default store;
